<template>
    <div v-loading="loading">
        <template>
            <el-descriptions :column="4" border class="margin-top" title="用户详情">
                <el-descriptions-item style="text-align: center;">
                    <template slot="label">
                        区号
                    </template>
                    {{ datas.country_code }}
                </el-descriptions-item>
                <el-descriptions-item>
                    <template slot="label">
                        手机号
                    </template>
                    {{ datas.mobile }}
                </el-descriptions-item>
                <el-descriptions-item>
                    <template slot="label">
                        性别
                    </template>
                    {{ datas.gender == 0? "未知" : datas.gender == 1? "男" : "女"  }}  
                    <!-- 0未知 1男 2女 -->
                </el-descriptions-item>

                <el-descriptions-item>
                    <template slot="label">
                        姓名
                    </template>
                    {{ datas.cert_name}} 
                </el-descriptions-item>

                <el-descriptions-item>
                    <template slot="label">
                        身份证号码
                    </template>
                    {{ datas.cert_no}} 
                </el-descriptions-item>

             
                <el-descriptions-item>
                    <template slot="label">
                        vip等级
                    </template>
                   {{ datas.vip_level}}
                </el-descriptions-item>
                <el-descriptions-item>
                    <template slot="label">
                        vip失效时间
                    </template>
                    {{ datas.vip_expire}} 
                </el-descriptions-item>

                <el-descriptions-item>
                    <template slot="label">
                        密码
                    </template>
                    {{ datas.password}} 
                </el-descriptions-item>

                <el-descriptions-item>
                    <template slot="label">
                        在线状态
                    </template>

                    <text v-if="datas.online == 0">0</text>
                    <text v-else-if="datas.online == 1">1</text>
                    <text v-else-if="datas.online == 2">2</text>
                    <text v-else>3</text>
             
                </el-descriptions-item>

                <el-descriptions-item :span="1">
                    <template slot="label">
                        邀请码
                    </template>
                    {{ datas.invitation_code}} 
                </el-descriptions-item>

                <el-descriptions-item>
                    <template slot="label">
                        父级用户
                    </template>
                    {{ datas.parent_id}} 
                </el-descriptions-item>

                <el-descriptions-item>
                    <template slot="label">
                        可用余额
                    </template>
                    {{ datas.balance}} 
                </el-descriptions-item>

                <el-descriptions-item>
                    <template slot="label">
                        提现余额
                    </template>
                    {{ datas.withdraw_balance}} 
                </el-descriptions-item>

                <el-descriptions-item>
                    <template slot="label">
                        禁用状态
                    </template>
                    {{ datas.disable == 0 ? "正常" :"禁用"}} 
                </el-descriptions-item>

                <el-descriptions-item>
                    <template slot="label">
                        资金密码
                    </template>
                    {{ datas.fun_password}} 
                </el-descriptions-item>

                <el-descriptions-item>
                    <template slot="label">
                        青少年模式密码
                    </template>
                    {{ datas.teenager_password}} 
                </el-descriptions-item>

                <!-- <el-descriptions-item>
                    <template slot="label">
                        <i class="el-icon-office-building"></i>
                        背景地址
                    </template>
                    {{ datas.background}} 
                </el-descriptions-item> -->

                <el-descriptions-item>
                    <template slot="label">
                        是否主播
                    </template>
                    {{ datas.is_anchor == 0? "否":"是"}} 
                </el-descriptions-item>


                <el-descriptions-item>
                    <template slot="label">
                        个人简介
                    </template>
                    {{ datas.subtitle}} 
                </el-descriptions-item>

             

                <el-descriptions-item>
                    <template slot="label">
                        所在城市
                    </template>
                    {{ datas.city}} 
                </el-descriptions-item>

                <el-descriptions-item>
                    <template slot="label">
                        登录IP
                    </template>
                    {{ datas.login_ip}} 
                </el-descriptions-item>

                <el-descriptions-item>
                    <template slot="label">
                        登录时间
                    </template>
                    {{ datas.login_at}} 
                </el-descriptions-item>

                <el-descriptions-item>
                    <template slot="label">
                        登录地址
                    </template>
                    {{ datas.login_address}} 
                </el-descriptions-item>

                <el-descriptions-item>
                    <template slot="label">
                        是否认证
                    </template>
                    {{ datas.authentication}} 
                </el-descriptions-item>

              

                <el-descriptions-item>
                    <template slot="label">
                        开启私人定制
                    </template>
                    {{ datas.customized == 0? "否":"是"}} 
                </el-descriptions-item>

                <el-descriptions-item>
                    <template slot="label">
                        注册IP
                    </template>
                    {{ datas.register_ip}} 
                </el-descriptions-item>

                <el-descriptions-item>
                    <template slot="label">
                        注册地址
                    </template>
                    {{ datas.register_address}} 
                </el-descriptions-item>

                <el-descriptions-item>
                    <template slot="label">
                        MAC地址
                    </template>
                    {{ datas.mac}} 
                </el-descriptions-item>

                <el-descriptions-item>
                    <template slot="label">
                        设备型号
                    </template>
                    {{ datas.model}} 
                </el-descriptions-item>

                <el-descriptions-item>
                    <template slot="label">
                        终端号码
                    </template>
                    {{ datas.terminal}} 
                </el-descriptions-item>

                <el-descriptions-item>
                    <template slot="label">
                        创建时间
                    </template>
                    {{ datas.created_at}} 
                </el-descriptions-item>

                <el-descriptions-item>
                    <template slot="label">
                        用户标签
                    </template>

                    <el-tag type="success" style="margin-right: 10px;" v-for="(item,index) in datas.labels" :key="index"> {{ item}} </el-tag>
                   
                </el-descriptions-item>

            </el-descriptions>

        </template>

        <div></div>
    </div>
</template>
      
<script>
export default {
    data() {
        return {
            visible: false,
            loading: false,
            tabdata: [],
            datas: {},
        }
    },
    mounted() {
        //this.getworksList()
        if (this.$route.query.id) {
            console.log('this.$route.query.id', this.$route.query.id)
            this.getAgentInfo(this.$route.query.id)
        }
    },
    methods: {
        getAgentInfo(id) {
            let that = this
            this.$request.get('/offline/get/' + id).then((res) => {
                that.tabdata = []
                that.datas = res

                console.log('getAgentInfo9999999999999999999', res)
                // that.tabdata.push(res)
            })
        },
    },
}
</script>
      
<style lang="scss" >
.el-button--text {
    margin-right: 20px !important;
}

.el-popover {
    width: 250px;
}
</style>